package com.crm.model.vo.trainingManager;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author yincuimei
 * @Date 2021/9/16 11:37
 * (用户模块)内训管理-》内训合同列表-》合同详情(合同信息)
 */
@Data
public class TrainingContractDetailVO {
    //内训合同主键
    private String trainingContractId;

    //合同编号
    private String contractNumber;

    //客户名称
    private String customerName;

    //客户联系人
    private String contactName;

    //客户联系方式
    private String contactDetails;

    //电子邮箱
    private String customerEmail;

    //合同开始日期
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date contractStartDate;

    //合同结束日期
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date contractEndDate;

    //应收金额
    private BigDecimal contractReceivables;

    //合同备注
    private String contractNotes;

    //合同状态:1-未生效；2-生效中；3-已结束；4-已作废；5-意外终止；6-挂起
    private String contractStatus;

    //合同状态(前端显示值)
    private String contractStatusText;

    //合同附件名
    private String fileName;

    //合同附件访问地址
    private String accessUrl;

    public String getContractStatusText(){
        String contractStatusText = "";
        if(!StringUtils.isBlank(contractStatus)){
            switch(contractStatus){
                case "1" :
                    contractStatusText = "未生效";
                    break;
                case "2" :
                    contractStatusText = "生效中";
                    break;
                case "3" :
                    contractStatusText = "已结束";
                    break;
                case "4" :
                    contractStatusText = "已作废";
                    break;
                case "5" :
                    contractStatusText = "意外终止";
                    break;
                case "6" :
                    contractStatusText = "挂起";
                    break;
                default :
            }
        }
        return contractStatusText;
    }
}
